package cn.smbms.vo;

public class ResultVo {

    private int code;
    private String msg;
    private Object result;

    public static ResultVo success(String msg){
        ResultVo resultVo=new ResultVo();
        resultVo.setCode(200);
        resultVo.setMsg(msg);
        return resultVo;
    }

    public static ResultVo success(Object result){
        ResultVo resultVo=new ResultVo();
        resultVo.setCode(200);
        resultVo.setResult(result);
        return resultVo;
    }

    public static  ResultVo failure(String msg){
        ResultVo resultVo=new ResultVo();
        resultVo.setCode(500);
        resultVo.setMsg(msg);
        return resultVo;
    }


    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getResult() {
        return result;
    }

    public void setResult(Object result) {
        this.result = result;
    }
}
